package com.tanhua.server.controller;

import com.tanhua.model.dto.UserLocationDto;
import com.tanhua.server.service.BaiduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wjs
 * @version 1.0
 * @date 2022/1/1 0001 下午 9:50
 */

@RestController
@RequestMapping("/baidu")
public class BaiduController {

    @Autowired
    private BaiduService baiduService;

    /**
     * 更新位置
     */
    @PostMapping("/location")
    public ResponseEntity updateLocation(@RequestBody UserLocationDto dto) {
        this.baiduService.updateLocation(dto);
        return ResponseEntity.ok(null);
    }
}
